<template>
  <div style="background:#ecf0f5">
    <el-row :gutter="24">
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-green bg-icon">
            <span class="daiqianfa"></span>
            <p class="icon-title">文章待签发数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span
              class="count-num">{{workData.todayDraftNum}}&nbsp;</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.draftNum}}</p>
          </div>
        </div>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-yellow bg-icon">
            <span class="daifabu"></span>
            <p class="icon-title">文章待发布数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span
              class="count-num">{{workData.todayToSignNum}}&nbsp;</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.toSignNum}}</p>
          </div>
        </div>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box ">
          <div class="bg-blue bg-icon">
            <span class="baoliao-daishenhe"></span>
            <p class="icon-title">爆料待审核数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span class="count-num">{{workData.todayWaitCheckFactNum}}</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.waitCheckFactNum}}</p>
          </div>
        </div>
      </el-col>

      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-purple bg-icon">
            <span class="wenda-daishenhe"></span>
            <p class="icon-title">问答待审核数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span class="count-num">{{workData.todayUserProblemNum}}</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.userProblemNum}}</p>
          </div>
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="24">
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-orange bg-icon">
            <span class="toufang"></span>
            <p class="icon-title">广告投放数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span
              class="count-num">{{workData.todayAdvApplyNum}}&nbsp;</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.advAdvApplyNum}}</p>
          </div>
        </div>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-blue-01 bg-icon">
            <span class="feedback-icon"></span>
            <p class="icon-title">意见反馈数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span
              class="count-num">{{workData.todayFeedbackNum}}&nbsp;</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.feedbackNum}}</p>
          </div>
        </div>
      </el-col>
      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box ">
          <div class="bg-purple-01 bg-icon">
            <span class="pl-daishenhe"></span>
            <p class="icon-title">评论待审核数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span class="count-num">{{workData.todayCommentNum}}</span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.commentNum}}</p>
          </div>
        </div>
      </el-col>

      <el-col :xs="24" :sm="12" :md="12" :lg="6" class="span24 index-flex">
        <div class="bg-box">
          <div class="bg-red bg-icon">
            <span class="zhuce"></span>
            <p class="icon-title">会员注册数</p>
          </div>
          <div class="bg-info">
            <p class="today-count">今日&nbsp;&nbsp;<span class="count-num">{{workData.todayAppUserNum}}</span>
              <span class="up-num"></span>
            </p>
            <p class="all-count">累计:&nbsp;&nbsp;{{workData.appUserNum}}</p>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import axios from 'axios'
  import Date from '@/untils/date';

  export default {
    data() {
      return {
        params: {},
        workData: {
          draftNum: 0,
          todayDraftNum: 0,
          toSignNum: 0,
          todayToSignNum: 0,
          waitCheckFactNum: 0,
          todayWaitCheckFactNum: 0,
          userProblemNum: 0,
          todayUserProblemNum: 0,
          advAdvApplyNum: 0,
          todayAdvApplyNum: 0,
          feedbackNum: 0,
          todayFeedbackNum: 0,
          todayCommentNum: 0,
          commentNum: 0,
          appUserNum: 0,
          todayAppUserNum: 0
        }
      };
    },
    methods: {
      getWorkData() {
        axios.post(this.$api.getWorkData, {}).then(res => {
          if (res.code == '200') {
            this.workData = res.body;
          }
        })
      },
    },
    mounted() {
      this.getWorkData();
      window.addEventListener('resize', this.createChart);
    }
  };
</script>


<style lang="scss" scoped>
  .gray-bg {

  }

  .span24 {
    margin-bottom: 24px;
  }

  .bg-box {
    background: #fff;
    height: 112px;
    display: flex;

    .bg-green {
      background: #17d57e;
    }

    .bg-yellow {
      background: #fec92b;
    }

    .bg-blue {
      background: #2da3fb;
    }

    .bg-purple {
      background: #c172d8;
    }
    .bg-orange {
      background: #FF7A7A;
    }
    .bg-red {
      background: #FF3D3D;
    }
    .bg-blue-01 {
      background: #0080FF;
    }
    .bg-purple-01 {
      background: #8000FF;
    }
  }

  .bg-icon {
    text-align: center;
    padding-top: 22px;
    width: 35%;
    height: 100%;

    .iconfont {
      margin-top: 24px;
      font-size: 40px;
      color: #fff;
      text-align: center;
    }

    .icon-title {
      color: #fff;
      font-size: 14px;
      text-align: center;
      margin-top: 10px;
    }
  }

  .bg-info {
    width: 65%;
    padding: 24px;
  }

  .today-count {
    color: #5a5e66;
    font-size: 14px;

    .count-num {
      font-size: 18px;
      position: relative;
      top: 2px;
      margin-right: 4px;
      color: #353535;
    }

    .up-num {
      font-size: 14px;
      color: #ff724c;
    }
  }

  .all-count {
    font-size: 14px;
    color: #999;
    margin-top: 24px;
  }

  .h358 {
    height: 358px;
    background: #fff;
  }

  .h440 {
    height: 440px;
    background: #fff;
  }

  .work-header {
    height: 50px;
    line-height: 50px;
    padding: 0 16px 0 24px;
    display: flex;
    justify-content: space-between;

    .iconfont {
      font-size: 20px;
      color: #999999;

      &:hover {
        color: #353535;
      }
    }
  }

  .work-body {
    background: #fff;
    height: 308px;
    padding: 0 24px;
  }

  .index-table {
    width: 100%;

    th {
      color: #878d99;
      font-size: 12px;
      padding-bottom: 10px;
    }

    td {
      border-bottom: 1px dotted #e6ebf3;
      height: 32px;
      line-height: 32px;
      color: #5a5e66;
      font-size: 12px;
    }

    tr:last-child {
      td {
        border-bottom: none;
      }
    }
  }

  .text-left {
    text-align: left;
  }

  .text-right {
    text-align: right;
  }

  .systemInfo {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 12px;

    span {
      margin-right: 14px;
    }
  }
</style>

